package com.ruoyi.web.controller.wlwsys;

import com.ruoyi.system.domain.PageBean;
import com.ruoyi.system.domain.SysNotice;
import com.ruoyi.system.service.impl.SysNoticeServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/wlwsys/information")
public class InformationController {
    @Autowired
    SysNoticeServiceImpl service;
   @GetMapping("/list")
   PageBean ListNotice(@RequestParam(value = "noticeType") String noticeType,
                                  @RequestParam(value = "page",defaultValue = "1") String page,
                                  @RequestParam(value = "pageSize",defaultValue = "5") String pageSize){
        PageBean sysNotices = service.selectNoticeByType(noticeType,page,pageSize);
        return sysNotices;
    }
    @GetMapping("/view")
    SysNotice viewContent(@RequestParam(value = "id") Integer id){
        SysNotice sysNotice = service.selectNoticeById((long) id);
        return sysNotice;
    }
}
